<div class="page-title">

    <div class="title-env">
        <h1 class="title">提现申请信息</h1>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('/')}"><i class="fa-home"></i>Home</a>
            </li>
            <li>

                <a href="{:url('cash/index')}">Cash</a>
            </li>
            <li class="active">

                <strong>Update</strong>
            </li>
        </ol>

    </div>

</div>
<div class="panel panel-default">


    <div class="panel-body">

        <form role="form" id="form1"  method="post" action="{:url('cash/edit')}" enctype="multipart/form-data" class="validate">
            <input type="hidden" name="id" value="{$data['id']}">
            <input type="hidden" name="status" id="status" value="{$data['status']}">
            <div class="form-group">
                <label class="control-label">金额</label>

                <input type="text" class="form-control" value="{$data['money']} x (1 - {$cashrate}) = {$data['money']*(1-$cashrate)}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">提现到</label>

                <input type="text" class="form-control" value="{:cash_type($data['type'])}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">支付宝姓名</label>

                <input type="text" class="form-control" value="{$user_auth['ali_name']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">支付宝账号</label>

                <input type="text" class="form-control" value="{$user_auth['ali_account']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">微信付款码</label>

                <a href="{$user_auth['wx_img']}" target="_blank"><img src="{$user_auth['wx_img']}" style="max-height: 200px; max-width: 400px;"></a>
            </div>
            <div class="form-group">
                <label class="control-label">银行卡姓名</label>

                <input type="text" class="form-control" value="{$user_auth['bank_card_name']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">银行卡号</label>

                <input type="text" class="form-control" value="{$user_auth['bank_card_number']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">开户行</label>

                <input type="text" class="form-control" value="{$user_auth['bank_name']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">手机号</label>

                <input type="text" class="form-control" value="{$user_auth['mobile']}"  placeholder="" readonly />
            </div>
            <div class="form-group">
                <label class="control-label">申请时间</label>

                <input type="text" class="form-control" value="{:date('Y-m-d H:i:s', $data['create_time'])}" readonly placeholder="" />
            </div>
            <div class="form-group">
                <label class="control-label">当前状态</label>

                <input type="text" class="form-control" value="{:cash_status($data['status'])}" readonly placeholder="" />
            </div>
            <div class="form-group">
                <label class="control-label">驳回原因（建议字数在20字以内）</label>

                <textarea class="form-control" id="refuse_reason" name="refuse_reason">{$data['refuse_reason']}</textarea>
            </div>
            <div class="form-group">
                <button type="button" onclick="update(2)" class="btn btn-success">提现成功</button>
                <button type="button" onclick="update(3)" class="btn btn-danger">驳回请求</button>
                <button type="reset" class="btn btn-white">重置</button>
            </div>

        </form>

    </div>

</div>

<script>
    setTimeout("$('#alert').fadeOut(1000)",2000)
    function update(status) {
        if(status == 3) {
            var refuse_reason = $('#refuse_reason').val();
            if(refuse_reason == '') {
                layer.msg('请填写驳回原因');
                return false;
            }
        }
        if(status == 2) {
            if(!confirm('确定提现成功？')) {
                return false;
            }
        }

        $('#status').val(status);
        $('#form1').submit();
    }
</script>